function requestAndroid(permissionID) {
	return new Promise((resolve, reject) => {
		plus.android.requestPermissions(
			[permissionID],
			function(resultObj) {
				var result = 0;
				for (var i = 0; i < resultObj.granted.length; i++) {
					var grantedPermission = resultObj.granted[i];
					console.log('已获取的权限:' + grantedPermission);
					result = 1
				}
				for (var i = 0; i < resultObj.deniedPresent.length; i++) {
					var deniedPresentPermission = resultObj.deniedPresent[i];
					console.log("拒绝本次申请的权限:" + deniedPresentPermission);
					result = 0
				}
				for (var i = 0; i < resultObj.deniedAlways.length; i++) {
					var deniedAlwaysPermission = resultObj.deniedAlways[i];
					console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
					result = -1
				}
				resolve(result);
			},
			function(error) {
				console.log("result error:" + error.message);
				resolve({
					code: error.code,
					message: error.message
				})
			}
		);
	});
}

function gotoAppsetting() {
	uni.openAppAuthorizeSetting({
		success(res) {
			console.log(res)
		}
	})
}

export default {
	requestAndroid,
	gotoAppsetting
}